package com.free.system.service.impl;

import java.util.List;
import com.free.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.free.system.mapper.FreeMemberMapper;
import com.free.system.domain.FreeMember;
import com.free.system.service.IFreeMemberService;
import com.free.common.core.text.Convert;

/**
 * 会员信息Service业务层处理
 * 
 * @author Sophia
 * @date 2025-02-25
 */
@Service
public class FreeMemberServiceImpl implements IFreeMemberService 
{
    @Autowired
    private FreeMemberMapper freeMemberMapper;

    /**
     * 查询会员信息
     * 
     * @param id 会员信息主键
     * @return 会员信息
     */
    @Override
    public FreeMember selectFreeMemberById(Long id)
    {
        return freeMemberMapper.selectFreeMemberById(id);
    }

    /**
     * 查询会员信息列表
     * 
     * @param freeMember 会员信息
     * @return 会员信息
     */
    @Override
    public List<FreeMember> selectFreeMemberList(FreeMember freeMember)
    {
        return freeMemberMapper.selectFreeMemberList(freeMember);
    }

    /**
     * 新增会员信息
     * 
     * @param freeMember 会员信息
     * @return 结果
     */
    @Override
    public int insertFreeMember(FreeMember freeMember)
    {
        freeMember.setCreateTime(DateUtils.getNowDate());
        return freeMemberMapper.insertFreeMember(freeMember);
    }

    /**
     * 修改会员信息
     * 
     * @param freeMember 会员信息
     * @return 结果
     */
    @Override
    public int updateFreeMember(FreeMember freeMember)
    {
        freeMember.setUpdateTime(DateUtils.getNowDate());
        return freeMemberMapper.updateFreeMember(freeMember);
    }

    /**
     * 批量删除会员信息
     * 
     * @param ids 需要删除的会员信息主键
     * @return 结果
     */
    @Override
    public int deleteFreeMemberByIds(String ids)
    {
        return freeMemberMapper.deleteFreeMemberByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员信息信息
     * 
     * @param id 会员信息主键
     * @return 结果
     */
    @Override
    public int deleteFreeMemberById(Long id)
    {
        return freeMemberMapper.deleteFreeMemberById(id);
    }
}
